<?php
$noSeasonChange = true;
$showStats = true;

include_once ("includes/init.php");
$sort = getParam("sort");
if (!isset ($sort)) {
    $sort = 1;
}
$id = getParam("id");
if (!isset ($id)) {
    $redirectStr = "No such team";
    $message = "Unable to identify team to show";
    include ("includes/redirect.php");
    return;
}
$team = $teams->getTeam($id);
if (!isset ($team)) {
    $redirectStr = "No such team";
    $message = "Unable to identify team $id";
    include ("includes/redirect.php");
    return;
}
$sort = getParam("sort");
if (!isset ($sort)) {
    $sort = 1;
}
$direction = getParam("dir");

$title = $team->name . " Dead and Retired";
include_once ("includes/header.php");

$deads = loadTeamPlayerDeads($id, $sort, $direction);

echo<<< EOQ
            <caption><h1><a href="team_viewer.php?id=$id">$team->name</a> <img src="images/skull-and-crossbones.png" title="Dead and Retired Players"/><br />Dead and Retired Players</h1></caption>
EOQ;


// Touchdownss
echoPlayerDeadsHeader($sort, $id);

for ($i = 0; $i < sizeof($deads); $i++) {
    $team = $teams->getTeam($deads[$i]->teamId);
    echoPlayerdeadsRow($team, $deads[$i], $i);
}
include ("includes/footer.php");
?>
